]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot-ui: Add a key to open the screencast UI
authorIvan Molodetskikh <yalterz@gmail.com>
Sat, 15 Jan 2022 16:07:15 +0000 (19:07 +0300)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Feb 2022 12:13:22 +0000 (12:13 +0000)
It replaces the "record a short screencast" key from g-s-d.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107>

data/50-gnome-shell-screenshots.xml
data/org.gnome.shell.gschema.xml.in
js/ui/screenshot.js

index d99f60bd214d8d509ac3729d087a5b02a905c18b..c82f1a3fb304bd08b8a3376dc1e6754c28173e95 100644 (file)
@@ -14,4 +14,7 @@
     <KeyListEntry name="screenshot-window"
                   description="Take a screenshot of a window"/>
 
+    <KeyListEntry name="show-screen-recording-ui"
+                  description="Record a screencast interactively"/>
+
 </KeyListEntries>
\ No newline at end of file
index e686d2203d1f72e3c01ba3ea062e22baeefece50..d3f3c702d22751f663eb56a4a75a0603a78072a4 100644 (file)
       <default>["Print"]</default>
       <summary>Take a screenshot interactively</summary>
     </key>
+    <key name="show-screen-recording-ui" type="as">
+      <default>["&lt;Ctrl&gt;&lt;Shift&gt;&lt;Alt&gt;R"]</default>
+      <summary>Record a screencast interactively</summary>
+    </key>
     <key name="screenshot-window" type="as">
       <default>["&lt;Alt&gt;Print"]</default>
       <summary>Take a screenshot of a window</summary>
index eb9d21a5df2132159474d1846380c2472e7cf0b3..c7ae64949a6225824311e8b033ba4d05e4159d71 100644 (file)
@@ -1297,6 +1297,14 @@ var ScreenshotUI = GObject.registerClass({
             showScreenshotUI
         );
 
+        Main.wm.addKeybinding(
+            'show-screen-recording-ui',
+            new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
+            Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
+            uiModes,
+            showScreenRecordingUI
+        );
+
         Main.wm.addKeybinding(
             'screenshot-window',
             new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
@@ -2187,6 +2195,15 @@ function showScreenshotUI() {
     });
 }
 
+/**
+ * Shows the screen recording UI.
+ */
+function showScreenRecordingUI() {
+    Main.screenshotUI.open(UIMode.SCREENCAST).catch(err => {
+        logError(err, 'Error opening the screenshot UI');
+    });
+}
+
 var ScreenshotService = class {
     constructor() {
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreenshotIface, this);